//package FirstHomeworks;
//
//import junit.framework.Assert;
//import org.openqa.selenium.support.ui.ExpectedConditions;
//import org.openqa.selenium.support.ui.WebDriverWait;
//import org.openqa.selenium.By;
//import RozetkaPages.BasePage;
//import RozetkaPages.HomePage;
//import util.ReportWriter;
//
//
//import java.util.concurrent.TimeUnit;
//
//public class RegistrationPage {
//
//    public void findRegistrationForm()
//    {
//        driver.findElement(By.name("signin")).click();
//        driver.findElement(By.cssSelector(".lightblue.auth-f-signup-link")).click();
//
//        WebDriverWait wait = new WebDriverWait(driver,20);
//        wait.until(ExpectedConditions.titleContains("Регистрация"));
//        Assert.assertTrue(driver.getPageSource().contains("Регистрация"));
//
//        ReportWriter.logElementPresent("Login form");
//    }
//
//    public void fillRegistrationForm(String name, String email, String password)
//    {
//        driver.findElement(By.xpath("//input[@name='title']")).sendKeys(name);
//        driver.findElement(By.xpath("//input[@name='email']")).sendKeys(email);
//        driver.findElement(By.xpath("//input[@name='password']")).sendKeys(password);
//        driver.findElement(By.cssSelector(".button-css-green")).click();
//
//        ReportWriter.info("Login form is filled in and submitted!");
//    }
//
//    public void loginIsSuccessful(String name, String email, String password)
//    {
//
//        fillRegistrationForm(name, email, password);
//
//        WebDriverWait wait = new WebDriverWait(driver,20);
//        wait.until(ExpectedConditions.titleContains("настройки"));
//        Assert.assertTrue(driver.getPageSource().contains("Личный кабинет"));
//
//        ReportWriter.info("Login is done. User Profile page is opened!");
//
//    }
//
//    public void loginIsFailed(String name, String email, String password)
//    {
//
//        fillRegistrationForm(name, email, password);
//
//        driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
//        driver.findElement(By.cssSelector("input[style='background-color: rgb(255, 214, 214);']"));
//        Assert.assertTrue(driver.getPageSource().contains("Регистрация"));
//
//        ReportWriter.info("Login is failed. Wrong user credentials were entered!");
//    }
//}